<?php
class DbConnector
{
	// Design Pattern : singleton
	private static $dbiConnector;
	private static $conf = array('DSN' => "pgsql:dbname=pizzadb;host=localhost", 'login' => 'pizzadb', 'password' => 'password');

	
	public static function get()
	{
		if(!isset(DbConnector::$dbiConnector))
		{
			// Instanciate a PDO connector for local DB
			DbConnector::$dbiConnector = new PDO(DbConnector::$conf['DSN'], DbConnector::$conf['login'], DbConnector::$conf['password']);
		}
		// Else, we got our connector
		
		return DbConnector::$dbiConnector;
	}
	
	//retourne les infos de la pizzeria
	//$infoPizzeria['name'] 
	public static function getInfoPizzeria(){
		$infoPizzeria=array();
		
		return $infoPizzeria;
		
	}
	//retourne la liste des pizzas sous forme de tableau associatif
	//$listePizza[$id]['nom']
	//$listePizza[$id]['prix']
	//$listePizza[$id]['base']
	//$listePizza[$id]['ingredients']
	public static function getListePizzas(){
		
	}
	//retourne la liste des ingredients d'une pizza sous forme de tableua associatif
	public static function getIngredientsFromPizza($idPizza){
		
	}
	public static function getListeMenus(){
		
	}
	public static function getListeBoissons(){
		
	}
}
?>